package com.hackordie.interfaces;

import com.hackordie.commons.authorities.Profile;
import com.hackordie.commons.authorities.Role;
import com.hackordie.commons.authorities.User;
import com.hackordie.commons.authorities.UserAccess;
import com.hackordie.commons.game.player.UserComponent;
import com.hackordie.commons.hardware.components.AComponent;
import com.hackordie.commons.hardware.computer.ComputerType;
import com.hackordie.exceptions.HackOrDieException;

public interface IHackOrDieManager {

	public boolean loginUser(String userName, String userPassword) throws HackOrDieException;

	// USER
	public boolean createUser(User user) throws HackOrDieException;
	public boolean deleteUser(int idUser) throws HackOrDieException;
	public boolean deleteUser(String userName) throws HackOrDieException;
	public boolean updateUser(User user) throws HackOrDieException;
	public boolean enableUser(int idUser) throws HackOrDieException;
	public boolean enableUser(String userName) throws HackOrDieException;
	public boolean disableUser(int idUser) throws HackOrDieException;
	public boolean disableUser(String userName) throws HackOrDieException;
	public User getUser(int idUser) throws HackOrDieException;
	public User getUser(String userName) throws HackOrDieException;
	public User[] getAllUsers() throws HackOrDieException;
	public User[] getAllUsersByRange(int first, int last) throws HackOrDieException;
	public int countAllUsers() throws HackOrDieException;	
	public UserAccess[] getUserAccess(int idUser) throws HackOrDieException;
	public UserAccess[] getUserAccess(String userName) throws HackOrDieException;
	public UserComponent[] getUserBagComponents(int idUser, boolean allData) throws HackOrDieException;
	
	//ALL
	public UserAccess[] getAllAccess() throws HackOrDieException;
	
	//PROFILE
	public boolean createProfile(Profile profile);
	public boolean deleteProfile(int idProfile) throws HackOrDieException;
	public boolean updateProfile(Profile profile) throws HackOrDieException;
	public Profile getProfile(int idProfile) throws HackOrDieException;
	public Profile[] getAllProfiles() throws HackOrDieException;
	
	//ROLE
	public boolean createRole(Role role);
	public boolean deleteRole(int idRole) throws HackOrDieException;
	public boolean updateRole(Role role) throws HackOrDieException;
	public Role    getRole(int idRole) throws HackOrDieException;
	public Role    getRole(String nameRole) throws HackOrDieException;
	public Role[]  getRoleByRange(int first, int last) throws HackOrDieException;
	public int countAllRoles() throws HackOrDieException;
	public Role[] getAllRoles() throws HackOrDieException;
	public boolean enableRole(int idRole) throws HackOrDieException;
    public boolean disableRole(int idRole) throws HackOrDieException;
	
	//COMPUTER
	public ComputerType[] getAllComputerType() throws HackOrDieException;
	public ComputerType[] getAllComputerTypeByRange(int first, int last) throws HackOrDieException;
	public int countAllComputerType() throws HackOrDieException;
	public boolean deleteComputerType(int idComputerType) throws HackOrDieException;
	public boolean addComputerType(ComputerType computerType);
	
	//COMPONENTS
	public AComponent[] getAllComponents() throws HackOrDieException;
    public AComponent[] getAllComponentsByRange(int first, int last) throws HackOrDieException;
    public int countAllComponents() throws HackOrDieException;
    public boolean deleteComponents(int idComponent) throws HackOrDieException;
    public boolean addComponents(AComponent component);
}
